local M = {}

---! 获取当前关卡
function M:get_stage_level()
    return self:query("stage_level") or 1
end

---! 获取当前回合数
function M:get_stage_round()
    return self:query_temp("stage", "round") or 0
end

---! 获取击杀怪物表
function M:get_stage_monster()
    local monster_map = self:query_temp("stage", "monster")
    return monster_map or self:set_temp("stage", "monster", {})
end

---! 开始新的回合
function M:start_new_round(round)
    ---! 重置关卡数据
    self:set_temp("stage", {
        ---! 记录当前时间
        time = os.time(),

        ---! 重置回合数
        round = round,
    })
end

---! 开始新的关卡
function M:start_new_stage(level)
    ---! 更新关卡等级
    self:set("stage_level", level)

    ---! 重置关卡数据
    self:start_new_round()
end

F_CHAR_STAGE = M
